using System.Data;
using ET;
namespace DA
{
	public class Domain_DAL
	{
	private clsConnect cls = new clsConnect();

	#region Getdata
	public DataTable BindGirdDomain(string keywords)
	{
        return cls.Search("sp_tb_Domain_Search", "@KeyWords", keywords);
	}
    //public DataTable BindGirdDomainDetail(int id)
    //{
    //}
	#endregion

	#region Insert
	public bool InsertDomain(Domain_ET data)
	{
	cls.CreateNewSqlCommand();
	cls.AddParameter("@National_Id", data.National_Id);
	cls.AddParameter("@Domain_Alias", data.Domain_Alias);
	cls.AddParameter("@Domain_Name", data.Domain_Name);
	cls.AddParameter("@Domain_Note", data.Domain_Note);
    cls.ExecuteNonQuery("sp_tb_Domain_Insert");
	return true;
	}
	#endregion

	#region Update
	public bool UpdateDomain(Domain_ET data)
	{
	cls.CreateNewSqlCommand();
	cls.AddParameter("@Domain_Id", data.Domain_Id);
	cls.AddParameter("@National_Id", data.National_Id);
	cls.AddParameter("@Domain_Alias", data.Domain_Alias);
	cls.AddParameter("@Domain_Name", data.Domain_Name);
	cls.AddParameter("@Domain_Note", data.Domain_Note);
    cls.ExecuteNonQuery("sp_tb_Domain_Update");
	return true;
	}
	#endregion

	#region Delete
	public bool DeleteDomain(int id)
	{
        cls.Delete("sp_tb_Domain_Delete", "@Domain_Id", id);
	return true;
	}
	#endregion
	}
}